/*
 *电力实时监测模块接口
 */
import request from "@/utils/request";

// 实时负载请求接口列表 错误码20003
export function loadList(data) {
  return request({
    url: "/device/emeter-data/load/list",
    method: "post",
    data,
  });
}

// 查询电设备最新状态列表(实时负载二级页面) 错误码 20004
export function newList(data) {
  const { pageNum, pageSize, ...other } = data;
  return request({
    url: `/device/emeter/latest/list?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data: { ...other },
  });
}

// 查询电设备最新状态列表(实时监控页面电表图形数据) 错误码 20005
export function newGraphlist(data) {
  return request({
    url: "/device/emeter/latest/graphlist",
    method: "post",
    data,
  });
}

// 设备数据极值记录 错误码 20006
export function postExtremumlist(data) {
  return request({
    url: "/device/emeter-data/extremum/list",
    method: "post",
    data,
  });
}

// 查询最新警报信息 错误码 20007
export function newAlarm(data) {
  return request({
    url: "/device/emeter/latest/alarm",
    method: "post",
    data,
  });
}

// 查询水表最新警报信息 错误码 200071
export function newWateralarm(data) {
  return request({
    url: "/device/wmeter/latest/alarm",
    method: "post",
    data,
  });
}

// 查询水设备最新状态列表(实时监控页面水表图形数据) 错误码 20008
export function postwaterList(data) {
  return request({
    url: "/device/wmeter/latest/graphlist",
    method: "post",
    data,
  });
}

// 水耗负载分析接口 错误码 20009
export function waterLine(data) {
  return request({
    url: "/device/wmeter/load/list",
    method: "post",
    data,
  });
}

// 前台轮询获取最新警报信息 错误码 200099
export function postPingpong(data) {
  return request({
    url: "/device/emeter/polling/alarm",
    method: "post",
    data,
  });
}

// 获取警报小计信息 错误码 200098
export function postTotal(data) {
  return request({
    url: "/device/emeter/alarm/subtotal",
    method: "post",
    data,
  });
}

// 获取水表警报小计信息 错误码 200097
export function postTotalwater(data) {
  return request({
    url: "/device/wmeter/alarm/subtotal",
    method: "post",
    data,
  });
}

// 获取电表警报流水信息 错误码 200098
export function postTotalalarm(data) {
  const { pageNum, pageSize, ...other } = data;
  return request({
    url: `/device/emeter/alarm/flowdata?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data: { ...other },
  });
}

// 获取电表警报流水详情信息 错误码 2000981
export function postalarmDetail(data) {
  const { pageNum, pageSize, ...other } = data;
  return request({
    url: `/device/emeter/alarm/detail?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data: { ...other },
  });
}

// 获取水表警报流水信息 错误码 200099
export function postTotalwateralarm(data) {
  const { pageNum, pageSize, ...other } = data;
  return request({
    url: `/device/wmeter/alarm/flowdata?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data: { ...other },
  });
}

// 获取水表警报流水信息 错误码 2000991
export function postwateralarmDetail(data) {
  const { pageNum, pageSize, ...other } = data;
  return request({
    url: `/device/wmeter/alarm/detail?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data: { ...other },
  });
}

// 设备当日线路损耗图形接口 错误码 20000992
export function geGraphtodayList(params) {
  return request({
    url: "/device/lineloss/graph/today/list",
    method: "get",
    params,
  });
}
